package zuoye6;

public class Bank {
    static String bankName;
    private String name;
    private String password;
    private double banlance;
    private double turnover;
    static void welcome(){
        System.out.println("欢迎来到"+bankName+"--------------");
    }

    public Bank(String name,String password,double turnover){
        this.name=name;
        this.password=password;
        this.turnover=turnover;
        this.banlance=turnover-10;
        System.out.println(name+"开户成功，账户余额"+banlance);
    }

    public void deposit(double  turnover){
        banlance=banlance+turnover;
        System.out.println(name+"您好，您的账户 已存入"+turnover+"元，"+"当前余额"+ banlance+"元");
    }

    public void withdrawal(String password,double turnover){
        if(this.password!=password){
            System.out.println("您输入的密码错误！");
            return;
        }
        if (banlance-turnover>0){
            banlance=banlance-turnover;
            System.out.println(name+"您好，您的账户 已取出"+turnover+"元，"+"当前余额"+banlance+"元");
        }else{
            System.out.println("对不起，您的余额不足！");
        }
    }
    static void welcomNext(){
        System.out.println("请携带好随身财物，欢迎下次光临"+bankName+"------------");
    }
}
